namespace ScrumSprintMonitor.Implementation
{
    #region #using Directives

    using System;

    using log4net;

    #endregion

    public class Log4netLogger<T> : LoggerBase<T>
    {
        private readonly ILog log4NetLogger;

        public Log4netLogger()
        {
            this.log4NetLogger = LogManager.GetLogger(typeof(T));
        }

        public override bool IsDebugEnabled
        {
            get { return this.log4NetLogger.IsDebugEnabled; }
        }

        public override bool IsErrorEnabled
        {
            get { return this.log4NetLogger.IsErrorEnabled; }
        }

        public override bool IsFatalEnabled
        {
            get { return this.log4NetLogger.IsFatalEnabled; }
        }

        public override bool IsInfoEnabled
        {
            get { return this.log4NetLogger.IsInfoEnabled; }
        }

        public override bool IsWarnEnabled
        {
            get { return this.log4NetLogger.IsWarnEnabled; }
        }

        public override void Debug(string format, params object[] args)
        {
            this.log4NetLogger.DebugFormat(format, args);
        }

        public override void Debug(Exception exception, string format, params object[] args)
        {
            this.log4NetLogger.Debug(string.Format(format, args), exception);
        }

        public override void Error(string format, params object[] args)
        {
            this.log4NetLogger.ErrorFormat(format, args);
        }

        public override void Error(Exception exception, string format, params object[] args)
        {
            this.log4NetLogger.Error(string.Format(format, args), exception);
        }

        public override void Fatal(string format, params object[] args)
        {
            this.log4NetLogger.FatalFormat(format, args);
        }

        public override void Fatal(Exception exception, string format, params object[] args)
        {
            this.log4NetLogger.Fatal(string.Format(format, args), exception);
        }

        public override void Info(string format, params object[] args)
        {
            this.log4NetLogger.InfoFormat(format, args);
        }

        public override void Info(Exception exception, string format, params object[] args)
        {
            this.log4NetLogger.Info(string.Format(format, args), exception);
        }

        public override void Warn(string format, params object[] args)
        {
            this.log4NetLogger.WarnFormat(format, args);
        }

        public override void Warn(Exception exception, string format, params object[] args)
        {
            this.log4NetLogger.Warn(string.Format(format, args), exception);
        }
    }
}